import 'package:flutter/material.dart';
import 'package:maihealth/class/login/page/loginPage.dart';
import 'package:maihealth/class/login/provide/loginProvide.dart';
import 'package:maihealth/utils/constant.dart';
import 'package:maihealth/utils/router.dart';
import 'package:provide/provide.dart';
class profilePage extends StatefulWidget {
  @override
  _profilePageState createState() => _profilePageState();
}

class _profilePageState extends State<profilePage> {
  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      appBar: AppBar(
        title: Text('我的'),
      ),
      body: Center(
        child: FlatButton(
          child: Text('注销登录'),
          color: ThemeColor,
          onPressed: (){
            final provide = Provide.value<loginProvide>(context);
            provide.exitLogin();//清除用户信息
            Router.changeRootPage(context,loginPage());
          },
        ),
      )
    );
  }
}